// 页面路径：store/index.js
import Vue from "vue";
import Vuex from "vuex";
import persistence from "vuex-uniapp-persistence";

import user from './user'
import address from './address'

Vue.use(Vuex); //vue的插件机制
//Vuex.Store 构造器选项
const store = new Vuex.Store({
    state: {
        safeArea: uni.getSystemInfoSync().safeArea,//安全区域信息
        bounding: uni.getMenuButtonBoundingClientRect(),//胶囊信息
        // 手机平台
        platform: uni.getSystemInfoSync().platform,
    },
    getters: {},
    mutations: {

    },
    modules: { user, address },
    plugins: [persistence("rabbit")],// 使用 持久化插件  rabbit 本地存储中的key
});
export default store;